Answer:

if ( num < 0 )
  System.out.println("The number " + num + " is negative");  // true-branch
else
{
  System.out.println("The number " + num + " is positive");  // false-branch
  System.out.print  ("positive numbers are greater ");       // false-branch   
  System.out.println("or equal to zero ");                   // false-branch
}                      
System.out.println("Good-bye for now");                      // always executed

The true branch has one statement. The false branch has one statement, a block containing three statements.

Practice

At a movie theater box office a person less than age 17 is charged the "child rate". Otherwise a person is charged "adult rate." Here is a partially complete program that does this:

import java.util.Scanner;
class BoxOffice
{
  public static void main (String[] args) 
  {
    Scanner scan = new Scanner( System.in );
    int age;
 
    System.out.println("Enter your age:");
    age = scan.nextInt();

    if (  )
    {
      System.out.println("Child rate.");   
    } 
    else
    {
      System.out.println("Adult rate.");   
    }
    System.out.println("Enjoy the show.");    // always executed
  }
}

In this program, the true branch and the false branch are both blocks. Each block has only one statement inside of it, but this is OK. All you need to do is complete the blank so the program picks the correct block for the age that was input.

QUESTION 9:

Fill in the blank. You might wish to make a copy of the program in your editor, make your proposed correction, and run it to see if it works as you think.